package ex.beans;

import org.apache.shiro.web.filter.authc.AuthenticationFilter;
import org.springframework.stereotype.Component;

import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

/**
 * @program: LearShiroSpringMvc
 * @description:
 * @author: Mr.Dai
 * @create: 2020-03-15 00:03
 **/
@Component
public class CustomAuthorizationFilter extends AuthenticationFilter {

    @Override
    protected boolean isAccessAllowed(ServletRequest request, ServletResponse response, Object mappedValue) {
        String path= ((String) mappedValue);
        System.out.println(path);
        if(true){
            return true;
        }else {
            return false;
        }

    }

    @Override
    protected boolean onAccessDenied(ServletRequest servletRequest, ServletResponse servletResponse) throws Exception {
        return false;
    }
}
